package com.well.WellProject.controller;

import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSONObject;
import com.well.WellProject.Service.impl.MainServiceImpl;

@Controller
public class MainController {

	@Resource MainServiceImpl mainService;
	
	/**
	  * 注册接口
	  */
	@RequestMapping(value = "/moRegister", method = RequestMethod.POST)
	@ResponseBody
	public JSONObject register(@RequestBody String param) {
		String resultStr = mainService.register(param);
		return JSONObject.parseObject(resultStr);
	}
	
	/**
	  * 登录接口
	  */
	@RequestMapping(value = "/moLogin", method = RequestMethod.POST)
	@ResponseBody
	public JSONObject login(@RequestBody String param) {
		String resultStr = mainService.login(param);
		return JSONObject.parseObject(resultStr);
	}
	
	
	/**
	  * 获取用户列表
	  */
	@RequestMapping(value = "/moGetUserList", method = RequestMethod.POST)
	@ResponseBody
	public JSONObject getUserList(@RequestBody String param) {
		String resultStr = mainService.getUserList(param);
		return JSONObject.parseObject(resultStr);
	}

	
}
